package main

import (
	"context"
	pb "github.com/goAdminMicroService/api/proto"
	"google.golang.org/grpc"
	"log"
	"net"
)

type B struct {
}

func (b *B) Get(context.Context, *pb.GetDetailRequest) (*pb.Detail, error) {
	return &pb.Detail{Name: "ffff"}, nil
}

func main() {
	srv := grpc.NewServer()
	pb.RegisterDetailsServer(srv, &B{})
	listen, err := net.Listen("tcp", "127.0.0.1:9999")
	if err != nil {
		log.Fatal(err)
	}
	defer listen.Close()
	if err = srv.Serve(listen); err != nil {
		log.Fatal(err)
	}
}
